package lendingbooks.book;

import lendingbooks.utils.ServiceCallException;
import lendingbooks.utils.ServiceManager;

import android.util.Log;

import com.google.gson.Gson;

public class BookDAO {
			
	private ServiceManager sm = new ServiceManager();
	
	public Book findByIsbn(String p_isbn) throws ServiceCallException{		
		Book book = new Book();	
		String responseText = sm.GET(ServiceManager.SERVICE.SEARCH_BY_ISBN, p_isbn);
		Gson gson = new Gson();
		try{
		book =	gson.fromJson(responseText, Book.class);
		}catch(Exception e)
		{
			Log.d("LENDINGBOOKS BookDAO",e.getMessage());
		}
		
		return book;			
	}
}
